package com.example.service.Impl;

import com.example.Dto.DrugDto;
import com.example.aspect.vo.DrugVo;
import com.example.entity.Drug;
import com.example.mapper.DrugMapper;
import com.example.service.DrugService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class DrugServiceImpl implements DrugService {

    @Autowired
    private DrugMapper drugMapper;

    /**
     * 动态查询药品信息
     * @param drugDto
     * @return
     */
    @Override
    public List<Drug> scanDrug_h2_16(DrugDto drugDto) {
        List<Drug> drug= drugMapper.scanDrugDetail_h2_16(drugDto);
        return drug;
    }

    /**
     * 根据药品编号删除药品信息
     * @param drugidH216
     */
    @Override
    public void deleteByDrygid_h2_16(String drugidH216) {
        drugMapper.deleteByDrugid_h2_16(drugidH216);
    }

    /**
     * 插入药品信息
     * @param drugVo
     */
    @Override
    public void insertDrug_h2_16(DrugVo drugVo) {
        drugMapper.insertDrugDetails_h2_16(drugVo);
    }
}
